package com.api.devices.domain.query;

import com.alibaba.fastjson2.JSONObject;
import com.api.common.utils.StringUtils;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
class RobotTreeQuery {
    private Long robotId;
    private JSONObject robotNameLocales;
    private String robotCode;
    private String type = "robot";
    @JsonIgnore
    private String strRobotName;
    private List<ElementTreeQuery> children;
    public void setStrRobotName(String strRobotName){
        if(StringUtils.isNoneBlank(strRobotName)){
            this.robotNameLocales = JSONObject.parseObject(strRobotName);
        }
        this.strRobotName = strRobotName;
    }
}